//
//  PKPlayListTableViewCell.m
//  PianKe
//
//  Created by mingtao on 15/10/6.
//  Copyright (c) 2015年 mingtao. All rights reserved.
//

#import "PKPlayListTableViewCell.h"

#import <UIImageView+WebCache.h>

@implementation PKPlayListTableViewCell



-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{


    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _leftView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 5, 60)];
        
        
        _titleLable = [[UILabel alloc]initWithFrame:CGRectMake(10, 5, 200, 20)];
        
        
        _userNameLable = [[UILabel alloc]initWithFrame:CGRectMake(10, 30, 200, 20)];
        
        _downLoadButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        
        _downLoadButton.frame = CGRectMake(WIHES-30, 20, 20, 20);
        
        
        [self.contentView addSubview:_leftView];
        
        [self.contentView addSubview:_titleLable];
        
        [self.contentView addSubview:_userNameLable];
        
        [self.contentView addSubview:_downLoadButton];
        
//        //播放器里面的属性
//        _imagecoverimg = [[UIImageView alloc]init];
//        _imagecoverimg.frame = CGRectMake(WIHES*2+30, 100, WIHES-30, HHIHEI/2);
//        
//        [self.contentView addSubview:_imagecoverimg];
//        
//        _labletitle =[[UILabel alloc]initWithFrame:CGRectMake(WIHES*2+30, HHIHEI/2+60, WIHES, 30)];
//        
//        [self.contentView addSubview:_labletitle];
        
    }
    return self;
}


-(void)setConfigureModel:(PKRadioModelDetailfile *)configureModel
{
    _configureModel = configureModel;
    _titleLable.text = configureModel.title;
    
    _userNameLable.text =[NSString stringWithFormat:@"by:%@",configureModel.playInfo.userinfo.uname];
    
    if (configureModel.isSelected) {
        
        _leftView.backgroundColor = [UIColor greenColor];
        
    }else
    {
        _leftView.backgroundColor = [UIColor whiteColor];
    }
    
    
   // NSLog(@"%@",configureModel.coverimg);
    //播放器里面属性赋值
//    [_imagecoverimg sd_setImageWithURL:[NSURL URLWithString:configureModel.coverimg]];
//    
//    _labletitle.text = configureModel.title;
    
    

}


















- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
